package com.lagou.hdfs;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * ClassName: SortMapper <br/>
 * Description: <br/>
 * date: 2020/9/1 3:30 下午<br/>
 *
 * @author colde<br />
 */
public class SortMapper extends Mapper<LongWritable, Text,LongWritable, NullWritable> {

    final LongWritable longWritable = new LongWritable();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        Long num = Long.valueOf(value.toString());
        longWritable.set(num);
        context.write(longWritable,NullWritable.get());
    }
}
